﻿#pragma once

#include "ComponentBase.h"

class SafeDoor : public ComponentBase
{
	Q_OBJECT

public:
	SafeDoor(QObject *parent);
	~SafeDoor();

	// 组件初始化处理函数
	virtual int ComponentInit() override;
	/*自检接口*/
	virtual bool ComponentCheckSelfState() override;
	/*复位接口*/
	virtual bool ComponentSelfReset() override;

	virtual void ResponseSystemState(int state) override;
	


private:
	int SetDIInfo(const QString& info);
	void TrigStop(bool flag);
	void TrigReset(bool flag);
	void TrigEntry(bool flag);
	void TrigStart(bool flag);

private:
	struct {
		bool valied;
		bool stop;
		bool reset;
		bool start;
		bool enter;
	} m_state = {};

	struct {
		int stop;
		int reset;
		int start;
		int enter;
	}m_setting = {};

};
